package com.ebid.templates.ten;

import java.text.MessageFormat;

public class WinBidBulletinPhase {

    public static String winBidBulletinPhase ="<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"+
            "<winBidBulletinPhase> \n" +
            "    <TENDER_PROJECT_CODE>{0}</TENDER_PROJECT_CODE>\n" +
            "    <BID_SECTION_CODES> \n" +
            "       {1}"+
            "    </BID_SECTION_CODES>\n" +
            "    <TENDER_CODE>{2}</TENDER_CODE>\n" +
            "    <NOTICE_NAME>{3}</NOTICE_NAME>\n" +
            "    <NOTICE_CONTENT>{4}</NOTICE_CONTENT>\n" +
            "    <NOTICE_NATURE>{5}</NOTICE_NATURE>\n" +
            "    <NOTICE_SEND_TIME>{6}</NOTICE_SEND_TIME>\n" +
            "    <NOTICE_MEDIA>{7}</NOTICE_MEDIA>\n" +
            "    <URL>{8}</URL>\n" +
            "    <SECTIONS_BIDDERS> \n" +
            "       {9}"+
            "    </SECTIONS_BIDDERS>\n" +
            "    <OTHER_CONTENT>{10}</OTHER_CONTENT>\n" +
            "    <BULLETIN_DUTY>{11}</BULLETIN_DUTY>\n" +
            "    <EXAMINER_NAME>{12}</EXAMINER_NAME>\n" +
            "    <ATTACHMENT_SET> \n" +
            "       {13}"+
            "    </ATTACHMENT_SET>\n" +
            "    <TRADE_PLAT>{14}</TRADE_PLAT>\n" +
            "    <PUB_SERVICE_PLAT_CODE>{15}</PUB_SERVICE_PLAT_CODE>\n" +
            "    <SUBMIT_TIMESTAMP>{16}</SUBMIT_TIMESTAMP>\n" +
            "  </winBidBulletinPhase>\n";


    private static String BID_SECTION_CODE ="<BID_SECTION_CODE>{0}</BID_SECTION_CODE>\n";


    private static String SECTIONS_BIDDER = "<SECTIONS_BIDDER> \n" +
            "        <BID_SECTION_CODE>{0}</BID_SECTION_CODE>\n" +
            "        <BIDDERS> \n" +
            "           {1}"+
            "        </BIDDERS>\n" +
            "      </SECTIONS_BIDDER>\n";

    private static String BIDDER = "<BIDDER> \n" +
            "            <BIDDER_CODE_TYPE>{0}</BIDDER_CODE_TYPE>\n" +
            "            <BIDDER_CODE>{1}</BIDDER_CODE>\n" +
            "            <BIDDER_NAME>{2}</BIDDER_NAME>\n" +
            "            <UNIONS> \n" +
            "             {3}"+
            "            </UNIONS>\n" +
            "            <WIN_RESULT> \n" +
            "              <PRICE> \n" +
            "                <WIN_PRICE>{4}</WIN_PRICE>\n" +
            "                <CURRENCY_CODE>{5}</CURRENCY_CODE>\n" +
            "              </PRICE>\n" +
            "              <RATE>{6}</RATE>\n" +
            "              <OTHER_WIN_PRICE>{7}</OTHER_WIN_PRICE>\n" +
            "            </WIN_RESULT>\n" +
            "          </BIDDER>\n";

    private static String UNION = "<UNION> \n" +
            "                <UNION_CODE>{0}</UNION_CODE>\n" +
            "                <UNION_NAME>{1}</UNION_NAME>\n" +
            "              </UNION>\n";

    private static String ATTACHMENT = "<ATTACHMENT> \n" +
            "        <ATTACHMENT_CODE>{0}</ATTACHMENT_CODE>\n" +
            "        <ATTACHMENT_FILE_NAME>{1}</ATTACHMENT_FILE_NAME>\n" +
            "        <FILE_TYPE>{2}</FILE_TYPE>\n" +
            "        <DATA_TIMESTAMP>{3}</DATA_TIMESTAMP>\n" +
            "        <MD5>{4}</MD5>\n" +
            "      </ATTACHMENT>\n";

    public static void setWinBidBulletinPhase(String winBidBulletinPhase,String s0, String s1, String s2, String s3, String s4, String s5, String s6,
                         String s7, String s8, String s9, String s10, String s11, String s12, String s13, String s14, String s15, String s16) {
        WinBidBulletinPhase.winBidBulletinPhase = MessageFormat.format(winBidBulletinPhase,s0,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,
                s11,s12,s13,s14,s15,s16);
    }

    public static void setBidSectionCode(String bidSectionCode,String s0) {
        BID_SECTION_CODE = MessageFormat.format(BID_SECTION_CODE,s0);
    }

    public static void setSectionsBidder(String sectionsBidder,String s0,String s1) {
        SECTIONS_BIDDER = MessageFormat.format(SECTIONS_BIDDER,s0,s1);
    }

    public static void setBIDDER(String BIDDER,String s0,String s1,String s2,String s3,String s4,String s5,String s6,String s7) {
        WinBidBulletinPhase.BIDDER = MessageFormat.format(BIDDER,s0,s1,s2,s3,s4,s5,s6,s7);
    }

    public static void setUNION(String UNION,String s0,String s1) {
        WinBidBulletinPhase.UNION = MessageFormat.format(UNION,s0,s1);
    }

    public static void setATTACHMENT(String ATTACHMENT,String s0,String s1,String s2,String s3,String s4) {
        WinBidBulletinPhase.ATTACHMENT = MessageFormat.format(ATTACHMENT,s0,s1,s2,s3,s4);
    }

    public static void createWinBidBulletinPhase(){
        setBidSectionCode(BID_SECTION_CODE,"");
        setUNION(UNION,"","");
        setBIDDER(BIDDER,"","","",UNION,"","","","");
        setSectionsBidder(SECTIONS_BIDDER,"",BIDDER);
        setATTACHMENT(ATTACHMENT,"","","","","");
        setWinBidBulletinPhase(winBidBulletinPhase,"",BID_SECTION_CODE,"","","","","","","",SECTIONS_BIDDER,"",
                "","",ATTACHMENT,"","","");
    }

    public static void main(String[] args) {
        createWinBidBulletinPhase();
        System.out.println(winBidBulletinPhase);
    }
}



